
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>熔断器的作用 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>熔断器的作用 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">理论</div>
          <div class="card-question">熔断器的核心作用是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">理论</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">熔断器的核心作用是通过预防性保护、快速故障响应和智能恢复机制，提高系统的可靠性和稳定性，避免单个服务故障引发连锁反应，减少系统的总体风险。</div>
          </div>
          <div class="card-source">来源: 文档开篇部分</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">熔断器是如何防止“服务雪崩效应”的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">当一个服务的依赖服务出现问题时，熔断器可以及时“熔断”对该服务的调用，避免故障请求持续传递，从而保护发起调用的服务不受影响，防止整个系统的崩溃。</div>
          </div>
          <div class="card-source">来源: 1. 防止服务雪崩效应</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">请描述熔断器的三种主要工作状态。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">熔断器主要有三种工作状态：1. 闭合状态（Closed）：默认状态，所有请求正常通过，同时监控失败率。2. 打开状态（Open）：当失败率超过阈值时进入此状态，所有请求都会被快速拒绝。3. 半开状态（Half-Open）：在打开状态一段时间后进入，允许部分请求通过以探测服务是否恢复。</div>
          </div>
          <div class="card-source">来源: 6.熔断器的工作状态</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">熔断器是如何实现“快速失败与快速恢复”的？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在服务出现问题时，熔断器会跳转到“打开”状态，立即拒绝请求（快速失败），避免系统资源被占用。当它检测到服务恢复正常后（通过半开状态），会自动恢复请求，使系统能尽快恢复到正常状态（快速恢复）。</div>
          </div>
          <div class="card-source">来源: 3. 快速失败与快速恢复</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">在熔断器的“半开（Half-Open）”状态下，系统会如何决策下一步的状态转换？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">在半开状态下，熔断器允许部分请求通过以检测服务的健康状态。如果这些请求的成功率良好，熔断器会切换回“闭合”状态；如果请求仍然失败，熔断器会重新切换回“打开”状态。</div>
          </div>
          <div class="card-source">来源: 6.熔断器的工作状态</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">熔断器机制在服务故障时如何改善用户体验？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">当服务发生故障时，熔断器能够快速响应并返回失败信息，避免用户面临长时间的请求超时等待。这让用户能及时获知服务不可用，从而提高了整体的用户体验。</div>
          </div>
          <div class="card-source">来源: 5. 提高用户体验</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
